/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package servlets;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Alice
 */
@WebServlet(name="SellerLandingServlet", urlPatterns={"/SellerLandingServlet"})
public class SellerLandingServlet extends HttpServlet {

    
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
         response.setContentType("text/html");
        
        PrintWriter out = response.getWriter();
       HttpSession session = request.getSession(false);
        if(session.getAttribute("seller")==null)
            response.sendRedirect(request.getContextPath() + "/ErrorLoginServlet");
        
        String mex=(String)session.getAttribute("confirm");
        
        String docType=
         "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">\n";    
out.println(docType+"<html>");
out.println("<head>"
+"<title>LANDING SELLER Page</title>"

+ "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/bootstrap.css\"> ");
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">");
out.println("<style type=\"text/css\">");
out.println("</style>");
out.println("</head>");
out.println("<body>");
out.println("<div class=\"navbar  navbar-inverse nvbar-fixed-top\">" +
"<div class=\"navbar-inner\">" +
"<div class=\"container\">" +
 

"<a class=\"btn btn-navbar navbar-inverse nvbar-fixed-top \" data-toggle=\"collapse\" data-target=\".nav-collapse\">" +
"<span class=\"icon-bar\"></span>" +
"<span class=\"icon-bar\"></span>" +
"<span class=\"icon-bar\"></span>" +
"</a>" +
 


           " <ul class=\"nav\">" +
   " <li><a href=\"#\"></a></li>" +
   " <li class=\"active\">" +
   " <a href=\"#\">Seller Page</a>" +
   " </li>" +     
   " <li><a href=\"http://localhost:8084/PROGETTO_WEB_1/LogoutServlet\">Log Out</a></li>" +
   " </ul>" +

"<div class=\"nav-collapse collapse\">" +

"</div>" +
 
"</div>" +
"</div> </div>");
out.println("<div id=\"wb_Text1\" style=\"position:absolute;left:84px;top:64px;\"> ");
out.println("<h2>Seller Page</h2> </div>");
    if (mex != null) {out.println("<div style=\"position:absolute;left:84px;top:140px;\"><h4 class=\"text-error\">"+mex+"</h4></div>");}

    
    out.println("<div  style=\"position:absolute;left:84px;top:200px;width:344px;height:28px;z-index:1;\" >" +

        "<form method=\"get\" action=\"SellerProdottiSearch\">" +
"<input type=\"submit\" onclick=a href=\"http://localhost:8084/PROGETTO_WEB_1/Products\" value=\"Visualizza Prodotti in Vendita\" class=\"btn btn-large btn-success\" ><br><br><br>" +
"</form>"+ 
"<form method=\"get\" action=\"SellerAggiungiProdotto\">" +
"<input type=\"submit\" onclick=a href=\"http://localhost:8084/PROGETTO_WEB_1/SellerAggiungiProdotto\" value=\"Aggiungi Prodotto da Vendere\" class=\"btn btn-large btn-success\" ><br><br><br>" +
"</form></div>"); 



out.println("</body>");
out.println("</html>");
session.setAttribute("confirm", null); 
    }

    }

